Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: automate releases with release-please #2664

Merged
merged 25 commits into from
Oct 13, 2023

Conversation

SgtPooki
Copy link
Member

@SgtPooki SgtPooki commented Oct 12, 2023

This PR enables release-please. some details at #2671 (comment)

@SgtPooki SgtPooki requested review from whizzzkid and a team as code owners October 12, 2023 04:52
@SgtPooki
Copy link
Member Author

flow:

  1. merge PRs... as normal.. an open release-please PRs will be kept up to date by release-please
  2. release-please creates a release PR that collects all these changes on main - https://github.com/ipfs/ipfs-companion/blob/89901efb6d89dcde7b653d8eb6ee379e69c37411/.github/workflows/ci.yml#L96-L108
    1. add files to handle version updates automatically (README.md)
  3. ready to release, you merge the release PR - https://github.com/ipfs/ipfs-companion/blob/89901efb6d89dcde7b653d8eb6ee379e69c37411/.github/workflows/ci.yml#L110-L115 runs
    1. git tag should be created but currently requires a manual tag creation on ipfs-companion
    2. need to attach binaries via action like https://github.com/ipfs/ipfs-companion/blob/89901efb6d89dcde7b653d8eb6ee379e69c37411/.github/workflows/ci.yml#L149C1-L157C118

For testing:

  • use option last-release-sha to specify a SPECIFIC commit
  • use option release-as to tag first release as a specific version, and then others will

@SgtPooki SgtPooki changed the title chore: bootstrap releases for path: . chore: automate releases with release-please Oct 13, 2023
@SgtPooki SgtPooki enabled auto-merge (squash) October 13, 2023 00:22
Copy link
Member Author

@SgtPooki SgtPooki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

self review. I think we're good to go, only took a whole day.

@@ -2,8 +2,8 @@

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the changes in this file are just changing repo strings from old ipfs-shipyard ones: s/ipfs-shipyard\/ipfs-desktop/ipfs\/ipfs-desktop/

Copy link
Contributor

@whizzzkid whizzzkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can be cleaned up more, not blocking though.

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
needs: [test, build]
if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch')
steps:
- uses: google-github-actions/release-please-action@v3.7.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the release please action can run both of these steps based on different context.

i.e. it'll run the release-pr step when a release PR does not exist and then it'll create a release in the next step.

One obv. question will be how will plugin work, you can have a check in the plugin to validate if it's in the PR creation phase or release creation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the plugin is in the PR creation phase and already validated in #2672

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm not sure if the other issues you brought up need looked at.. we could just call npm run release-pr or npm run release-gh appropriately where we need to?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does that also handle the tag-creation? combining steps simplifies maintainence.

{
"bootstrap-sha": "ef61c998865ee90731e0bd495cc825a43c6fac60",
"group-pull-request-title-pattern": "chore${scope}: release${component} v${version}",
"extra-files": [],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would be nicer to use this entry to hook into in the plugin to make changes to the semver?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extending extra-files to do what we needed to do would require changing the inner logic of their primary updater: https://github.com/googleapis/release-please/blob/main/src/updaters/generic.ts#L103

release-please-config.json Outdated Show resolved Hide resolved
Comment on lines +24 to +25
"release-pr": "release-please release-pr --token=$GH_TOKEN --plugin '@ipfs-shipyard/release-please-ipfs-plugin' --repo-url=ipfs/ipfs-desktop --trace --debug --draft-pull-request",
"release-gh": "release-please github-release --token=$GH_TOKEN --repo-url=ipfs/ipfs-desktop --trace --debug --draft"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this beneficial to have here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so.. having commands users can run easily (see developer-notes.md) is very beneficial

Copy link
Contributor

@whizzzkid whizzzkid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

send it

@SgtPooki SgtPooki merged commit 11c30fc into main Oct 13, 2023
@SgtPooki SgtPooki deleted the release-please/bootstrap/default branch October 13, 2023 07:22
@SgtPooki
Copy link
Member Author

Note that the following commits (pushed directly to main) were required to get things actually working:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants